{extend name="$_admin_layout"}

{block name="tpl_vars"}
    {assign name="page_title" value="配置管理" /}
{/block}

{block name="main-content"}
    <div class="nav-tabs-custom">
        <ul class="nav nav-tabs">
            <?php foreach (config('ADMIN_CONFIG_GROUP_LIST') as $key => $title): ?>
                <?php if ($group == $key): ?>
                    <li class="active"><a href="#">{$title}</a></li>
                <?php else: ?>
                    <li><a href="{:$_controller->url('index', array('group' => $key))}">{$title}</a></li>
                <?php endif; ?>
            <?php endforeach; ?>
        </ul>

        <div class="tab-content">
            <div class="tab-pane active">
                <form id="config_list" class="table-form table-manager">
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="table-fixed-toolbar">
                                {:helper('admin/toolbar')->render_button('新建', 'fa fa-plus', 'btn btn-primary form-get', array('url' => $_controller->url('create')))}
                                {:helper('admin/toolbar')->render_button('删除', 'fa fa-trash', 'btn btn-danger ajax-post selected disabled', array('url' => $_controller->url('bulk_delete'), 'confirm-text' => '确定删除选择的数据吗？'))}
                            </div>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-sm-12">
                            <table class="table table-bordered table-striped table-hover">
                                <thead>
                                    <tr>
                                        <th class="list-ids">{:helper('admin/table')->render_header_select()}</th>
                                        <th>{:helper('admin/table')->render_header_text('ID')}</th>
                                        <th>{:helper('admin/table')->render_header_text('名称')}</th>
                                        <th>{:helper('admin/table')->render_header_text('标题')}</th>
                                        <th>{:helper('admin/table')->render_header_text('排序')}</th>
                                        <th>{:helper('admin/table')->render_header_text('状态')}</th>
                                        <th>{:helper('admin/table')->render_header_text('操作')}</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    {notempty name="config_list"}
                                        {foreach name="config_list" item="vo"}
                                            <tr>
                                                <td>{:helper('admin/table')->render_column_select($vo['id'], array('selected' => $pagination['selected']))}</td>
                                                <td>{:helper('admin/table')->render_column_text($vo['id'])}</td>
                                                <td>{:helper('admin/table')->render_column_text($vo['name'])}</td>
                                                <td>{:helper('admin/table')->render_column_text($vo['title'])}</td>
                                                <td>{:helper('admin/table')->render_column_text($vo['sort'])}</td>
                                                <td>{:helper('admin/table')->render_column_status($vo['status'])}</td>
                                                <td>
                                                    {:helper('admin/table')->render_action('修改', 'fa fa-edit', 'btn btn-primary btn-xs form-get', array('url' => $_controller->url('modify', array('id' => $vo['id']))))}
                                                </td>
                                            </tr>
                                        {/foreach}
                                    {else /}
                                        {:helper('admin/table')->render_empty_row()}
                                    {/notempty}
                                </tbody>
                            </table>

                            {notempty name="config_list"}
                                {:helper('admin/table')->render_pagination($pagination, $_controller->url('index', array('page' => '[page]')))}
                            {/notempty}
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
{/block}
